package com.wenjing.xiaoyun.chat.agent;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;

/**
 * @author jiangshizhang
 * @version 1.0
 * @description: 智能体上下文
 * @date 2025/7/22 11:01
 */
@Service
@Slf4j
public class AgentContext {
    private final XiaoYunChatAssistant xiaoYunChatAssistant;

    public AgentContext(XiaoYunChatAssistant xiaoYunChatAssistant) {
        this.xiaoYunChatAssistant = xiaoYunChatAssistant;
    }


    public Flux<String> chat(String name, Long memoryId, String userMessage) {
        switch (name) {
            case "xiaoYunChatAssistant":
                return xiaoYunChatAssistant.chat(memoryId, userMessage);
            default:
                throw new RuntimeException("无对应智能体");
        }

    }
}
